<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>tab 切换</title>
    <style>
        *{
            border: 0;
            padding: 0;
            margin: 0;
            box-sizing: border-box;
            -webkit-box-sizing: border-box;
        }
        .clearflix::after{
            content: '';
            display: block;
            clear: both;
        }
        ul>li{
            list-style: none;
        }
        main{
            width: 1000px;
            margin: 0 auto;
            padding-top: 20px;
        }
        .tab-box{
            width: 600px;
            margin: 0 auto;
            overflow: hidden;
        }
       .tab-nav>li{
           float: left;
           width: 200px;
           height: 30px;
           text-align: center;
           line-height: 30px;
           background-color: #f03107;
           color: #ffffff;
         
       }
       .tab-nav>li.on{
        background-color: #3ca0ec;
       }
       .tab-content{
           width: 1800px;
           height: 200px;
           position: relative;
       }
       .tab-content>.tab-item{
           width: 600px;
           height: 100%;
           text-align: center;
           border: 1px solid #cccccc;
           padding-top: 20px;
           float: left;
       }
      
   
    </style>
</head>
<body>
    <main>
        <div class="tab-box" id="tabBox">
            <ul class="tab-nav clearflix">
                <li>菜单一</li>
                <li>菜单二</li>
                <li>菜单三</li>
            </ul>
            <div class="tab-content">
                <div class="tab-item">内容一</div>
                <div class="tab-item">内容二</div>
                <div class="tab-item">内容三</div>
            </div>
        </div>
    </main>
</body>
<script src="./tab.js"></script>
<script>
 new Tabs({
        element:document.querySelector('#tabBox'),
        event:'hover',
        activeClassName:'on',
        motion:'left',
        duration:'1.5s'
    })

   
</script>
</html>